package com.lc202309;

/**
 * Description:
 *
 * @Create 2023/8/29 23:41
 * @Version 1.0
 */
public class Solution26 {
    public int removeDuplicates(int[] nums) {
        int num = 1;
        int tmp = nums[0];
        for (int i : nums) {
            if (i != tmp) {
                num += 1;
                tmp = i;
                nums[num - 1] = i;
            }
        }
        return num;
    }
}
